#define makeApplyToDoList(list,defkey)
	#if(list&&list.size()>0)
		<div class="media" style="margin-bottom: 15px;">
		    <div class="media-left">
		        <i class="demo-pli-laptop text-main icon-3x"></i>
		    </div>
		    <div class="media-body">
		        <p class="text-main text-lg mar-no">#(WorkFlowUtil.getDefNameByDefKey(defkey))</p>
		        <small>您收到<span class="padding-lr10 text-pink">#(list?list.size():"0")</span>条内部#(name)任务，请及时办理</small>
		    </div>
		</div>
         #for(t:list)
         	<p>
         		<small class="text-mint">#(t.applyer_name)</small>
         		<small class="text-mint padding-l10">#(t.org_name)</small>
         		<span class="text-success padding-l10">#(t.TASKNAME)&nbsp;</span>
         		<span class="text-info padding-l10">#(t.title)</span>
         		<small class="padding-l10">#(t.create_time)</small>
         		<a class="text-primary padding-lr10" href="javascript:void(0)" onclick="doTask('#(t.TASKID)','#(t.id)','#(defkey)',this)">办理</a>
         	</p>
         #end
     #end
#end
#define makeToDoList(todo)
	     	<p>
         		<span class="text-success padding-l10">#(todo.DEFNAME)&nbsp;</span>
	     		<small class="text-mint">#(todo.UserName)</small>
	     		<span class="text-success padding-l10">#(todo.TASKNAME)&nbsp;</span>
	     		<span class="text-info padding-l10">#(todo.title)</span>
	     		<small class="padding-l10">#(todo.create_time)</small>
	     		<a class="text-primary padding-lr10" href="javascript:void(0)" onclick="doTask('#(todo.TASKID)','#(todo.businessId)','#(todo.DEFKEY)')">办理</a>
	     	</p>
#end

<style>
	.padding-lr10{
		padding-left:10px;
		padding-right:10px;
	}
	.padding-l10{
		padding-left:10px;
	}
	.demo-icon i{
		color:white;
	}
	.tab-base .nav-tabs > li{
		width:120px;
	}
	.tab-base .nav-tabs > li.active > a{
	  	/* border-color: #26a69a !important; */
		border-right: none;
		margin-right: -1px;
		background-color: #fff;
		color: #000;
		font-weight: 900;
	}
	.tab-base .nav-tabs > li > a {
		border:none !important;
	}
	.tab-base .nav-tabs > li > a:hover {
	  	/* border-color: #26a69a; */
	  	border-right: none;
		margin-right: -1px;
		background-color: #fff;
		color: #000;
		font-weight: 900;
		border:none !important;
	}
</style>


                <div id="page-content">
					    <div class="col-sm-9">
						    <!-- 工作台Start -->
						    <div class="panel ">
								<div class="panel-heading">
								    <div class="panel-control">
								        <ul class="nav nav-tabs">
								            <li class="active"><a data-toggle="tab" href="#todolistPanel">待办任务<span class="pull-right badge badge-warning todoListCount">#(todoListCount)</span></a></li>
								        </ul>
								    </div>
								    <h3 class="panel-title">工作台</h3>
								</div>
								<div class="panel-body">
								    <div class="tab-content">
								        <div id="todolistPanel" class="tab-pane fade in active">
								        			#for(map:todoMap)
								        				#@makeApplyToDoList(map.value,map.key)
								        			#end
								        </div>
								        <!-- 已办Start -->
								    </div>
								</div><!-- panel-body end -->
							</div>
							<!-- 工作台End -->
						</div>
					    <div class="col-sm-3">
					        <div class="panel ">
						        <div class="panel-heading">
				                    <h3 class="panel-title">通知公告</h3>
				                </div>
				                <div class="panel-body" style="padding: 0px;">
				                    <div class="list-group">
				                        #for(notice:NoticeList)
				                        	<a href="javascript:void(0);" onclick="viewNotice('#(notice.id)')" class="list-group-item" style="padding: 5px 10px;">
					                            <h5 class="list-group-item-heading">#(notice.title)</h5>
					                            <p class="list-group-item-text">
					                            	<div style="word-break: break-all;word-wrap: break-word;">
							                            #if(notice.text_content)
					                            			#if(notice.text_content.length()>15)
					                            				#(notice.text_content.substring(0,15))
					                            			#else
					                            				#(notice.text_content)
					                            			#end
						                            	#end
					                            	</div>
							                        <div style="height: 1px;">
					                            		<code style="color:#26a69a;float: right;font-size: 12px;padding: 0px 9px;">#(notice.publish_time)</code>
					                            	</div>
					                            </p>
					                        </a>
					                	#end
				                    </div>
				                </div>
					        </div>
					    </div>
                </div>
                <script type="text/javascript">
						$(document).ready(function(){
						});
						/***
						 * 办理任务
						 */
						var nowTask;
						function doTask(taskid,id,defkey,o){
							layer.open({
								  type: 2,
								  title: false, //不显示标题栏
								  area: ['1000px', '620px'],
								  shade: 0.2,
								  id: 'selectOneMenu', //设定一个id，防止重复弹出
								  resize: false,
								  closeBtn: false,
								  isOutAnim : false , 
								  btnAlign: 'c',
								  content: ctx+'/admin/oa/workflow/flowtask/getDoTaskPage?taskid='+taskid+'&id='+id+'&defkey='+defkey,
								  success: function(layero){
										nowTask = o;
								  }
							});
						}
						function successCompleteTask(){
							$(nowTask).parents("p").remove();
							var todoListCount = $(".todoListCount").text();
							$(".todoListCount").text(todoListCount-1);
						}
						//查看通知公告
						function viewNotice(id){
							var thisLay;//弹出层
							layer.open({
								  type: 2,
								  title: false, //不显示标题栏
								  area: ['900px', '620px'],
								  shade: 0.2,
								  id: 'selectOneMenu', //设定一个id，防止重复弹出
								  resize: false,
								  closeBtn: false,
								  isOutAnim : false , 
								  btn: ['签收', '取消'], 
								  btnAlign: 'c',
								  content: ctx+'/admin/oa/notice/viewNotice?id='+id,
								  success: function(layero){
									  thisLay = window[layero.find('iframe')[0]['name']]; 
								  },
								  yes: function(){
									  thisLay.pointLion.confimMsg("您将要签收该公告！<br/><span style='color:green;'>签收之后公告发布人员可知晓您签收状态和时间！</span> <br/>点击确认进行签收 , 点击取消取消该操作",null,function(){
										  	var data = common_ajax.ajaxFunc("/admin/oa/notice/sign",{"id":id}, "json", null);
											if(data.success){
												layer.closeAll();
												pointLion.alertMsg(data.message,"success",null,null);
											}else{
												pointLion.alertMsg(data.message,"success",null,null);
											}
										});
								  }
							});
						}
				</script>

